package Thread;

public class ThreadDemo1 extends Thread {//继承Thread方式创建线程 优点操作简单 缺点不能继承其他类了，不便于扩展,不能返回结果
    public static void main(String[] args) {
        ThreadDemo1 threadDemo1 = new ThreadDemo1();
        threadDemo1.start();
        for (int i = 0; i <100 ; i++) {
            System.out.println("主线程执行。。。");
        }
    }

    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println("子线程执行。。。");
        }
    }
}
